import request from "@/api/index"

export default{
  /**
   * @description: 添加设备 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
   add(params){
    const url = "/iot/equipment/add"
    return request.post(url,{
      homeBaseId:sessionStorage.getItem("homeBaseId"),
      homeBaseType:sessionStorage.getItem("homeBaseType"),
      ...params
    })
  },
  /**
   * @description: 编辑设备 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
   edit(params){
    const url = "/iot/equipment/edit"
    return request.post(url,{
      homeBaseId:sessionStorage.getItem("homeBaseId"),
      homeBaseType:sessionStorage.getItem("homeBaseType"),
      ...params
    })
  },
  /**
   * @description: 单个删除设备 *代表必填
   * @param {String/Number} id *
   * @return {Object}
   */
  delListById(params){
    const url = "/iot/equipment/delListById"
    return request.get(url,params)
  },
  /**
   * @description: 单个删除设备 *代表必填
   * @param {String/Number} id *
   * @return {Object}
   */
   delById(params){
    const url = "/iot/equipment/delById"
    return request.get(url,params)
  },
  /**
   * @description: 条件查询 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
  queryByCondition(params){
    const url = "/iot/equipment/queryByCondition"
    return request.post(url,{
      homeBaseId:sessionStorage.getItem("homeBaseId"),
      homeBaseType:sessionStorage.getItem("homeBaseType"),
      ...params
    })
  },
  /**
   * @description: 获取当前基地所有设备列表 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
  queryRtuByCompanyMark(params) {
    return request.get(`iot/iotPlatform/queryRtuByCompanyMark`,{
      companyMark:sessionStorage.getItem('companyMark'),
      ...params
    })
  },
  /**
   * @description: 根据鱼塘Id查询设备 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
  queryByFishPondId(params) {
    return request.get(`/iot/equipment/queryByFishPondId`,{
      ...params
    })
  },
  /**
   * @description: 分页查询设备 *代表必填
   * @param {Object} params *
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @return {Object}
   */
   queryPageByCondition(params){
    const url = "/iot/equipment/queryPageByCondition"
    return request.post(url,{
      homeBaseId:sessionStorage.getItem("homeBaseId"),
      homeBaseType:sessionStorage.getItem("homeBaseType"),
      ...params
    })
   }
}